package com.ssau.tnp.server;

import java.net.ServerSocket;
import java.net.Socket;

public class Server {

    private static ServerSocket serverSocket;

    public static void main(String[] arg0) {
	int port = 4444;
	try {
	    System.out.println("Welcome to Server side");
	    serverSocket = new ServerSocket(port);
	    while (true) {
		Socket socket = serverSocket.accept();
		System.out.println("Client connect to server");
		Runnable r = new ThreadedEchoHandler(socket);
		Thread t = new Thread(r);
		t.start();
	    }
	} catch (Exception e) {
	    e.printStackTrace();
	}
    }
}
